<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	{include="style"}

</head>
<body >
  <div class="layui-rows" style="    margin-top: 10px;">
    <form class="layui-form" action="">
	<!--表单必须要携带ID-->
	<input name="id" value="{$plugins['id']}" type="hidden">
  <div class="layui-form-item">
    <label class="layui-form-label">账号：</label>
    <div class="layui-input-inline">
      <input type="text" name="username" required  value="{$config['username']}" lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
    </div>
	<div class="layui-form-mid layui-word-aux">账号提示信息</div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">密码：</label>
    <div class="layui-input-inline">
      <input type="password" name="password"  value="{$config['password']}"  required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
    </div>
    <div class="layui-form-mid layui-word-aux">密码提示信息</div>
  </div>
 
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
</form>
</div>

    <script>
        $(function  () {
			
            layui.use('form', function(){
              var form = layui.form;
             
              //监听提交
              form.on('submit(formDemo)', function(data){
           
				$.post("{fun U('setconf')}",data.field,function(res){
				    //console.log(res);return false;
					 var res = JSON.parse(res);
					 if(res.code==1){
						layer.msg(res.msg);
					 }else{
						layer.msg(res.msg, {icon: 6,time: 2000},function(){
						window.location.reload();
						});
                     
						
						 
					 }
				})
				
                return false;
              });
            });
        })

        
    </script>

    
 
</body>
</html>